package com.yf.user.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

@Data
@NoArgsConstructor
public class DrMemberBaseInfo {
	/**
	 * 主键id
	 */
	private Integer id;

	/**
	 * 会员ID
	 */
	private Integer uid;

	/**
	 * 真实姓名
	 */
	private String realName;

	/**
	 * 性别，值为：1男，2女，0保密
	 */
	private Integer sex;
	
    /**
     * 年龄
     */
    private Integer age;

	/**
	 * 出生日期
	 */
	private Date birthDate;

	/**
	 * 邮箱地址
	 */
	private String email;

	/**
	 * 身份证号码
	 */
	private String idCards;

	/**
	 * 身份证详细住址
	 */
	private String idAddress;

	/**
	 * 居住地详细地址
	 */
	private String nowAddress;

	/**
	 * 婚姻状况
	 */
	private Integer marry;
	
	/**
	 * 婚姻状况 对应名称
	 */
	private String marryName;

	/**
	 * 行业类别
	 */
	private Short industryType;

	/**
	 * 职位
	 */
	private String job;

	/**
	 * 添加时间
	 */
	private Date addTime;
	private Integer degree;// 学历
	private String degreeName;// 学历
	
	private String gschool;// 毕业院校
	private Integer salary;// 月收入
	private Integer companySize;// 公司规模
	/**
	 * 修改时间
	 */
	private Date updTime;

	private String userName;

	private String consignee;//收货人
	private String phone;//收货手机号
	private String region;//所在区域(省,市,区)

	public String getAsteriskIdCards(){
		if (StringUtils.isEmpty(idCards)){
			return StringUtils.EMPTY;
		}
		String last4Str = idCards.substring(idCards.length() - 4, idCards.length());
		String frist4Str = idCards.substring(0, 3);
		int j = idCards.length() - 7;
		StringBuilder stringBuilder = new StringBuilder();
		for(int i = 0; i < j; i++){
			stringBuilder.append("*");
		}
		return frist4Str + stringBuilder + last4Str;
	}


	public Integer getId() {
		return id;
	}

	public DrMemberBaseInfo(Integer uid,String consignee, String phone, String region, String nowAddress) {
		this.uid = uid;
		this.consignee = consignee;
		this.phone = phone;
		this.region = region;
		this.nowAddress = nowAddress;
	}



}